package com.lixl.collection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class JDBCDemo {

	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		
		Class.forName("com.jdbc.mysql");
		Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/database"); 
		PreparedStatement pstmt = conn.prepareStatement("query sql ??");
		pstmt.setObject(1, "value");
		ResultSet rs = pstmt.executeQuery();
		while(rs.next()){
			String columnLabelValue =  rs.getString("columnLabel");
			System.out.println(columnLabelValue);
		}
		pstmt.close();
		conn.close();
	}

}
